//==========================================================================
// Copyright (c) 2000-2008,  Elastos, Inc.  All Rights Reserved.
//==========================================================================
#ifndef _WIN32_SERIAL_H_
#define _WIN32_SERIAL_H_

#include "../serialio.h"

struct serial_res_t;

serial_res_t * win32_serial_init(
    INT comport);
INT win32_serial_read(
    serial_res_t *io,
    BYTE *pBuffer,
    UINT Size,
    UINT* pSizeRead);
INT win32_serial_write(
    serial_res_t *io,
    const BYTE *pBuffer,
    UINT Size,
    UINT* pSizeWritten);
void win32_serial_uninit(
    serial_res_t *io);
void win32_serial_abort(
    serial_res_t *io);
void win32_serial_WaitForEvent(
    serial_res_t *io);
DWORD win32_serial_GetInQueueSize(
    serial_res_t *io);
void win32_serial_FlushOutput(
    serial_res_t *io);
void win32_serial_FlushInput(
    serial_res_t *io);
void win32_serial_SetCommBlock(
    serial_res_t *io, INT bBlock);
void win32_serial_SetCommTimeouts(
    serial_res_t *io,
    SERIAL_TIMEOUTS *timeouts);
void win32_serial_SetSerialInfo(
    serial_res_t *io,
    SerialInfo *info);

#endif // _WIN32_SERIAL_H_
